import http from "../utils/request";

/**
 * 获取电影列表数据
 */
export function getFilmList(cityId, pageNum, pageSize) {
  return http({
    header: {
      "X-Host": "mall.film-ticket.film.list",
    },
    url: "https://m.maizuo.com/gateway",
    method: "GET",
    //  根据 请求方式 来决定是拼接在 url 地址上，还是请求体的数据
    data: {
      cityId,
      pageNum,
      pageSize,
      type: 1,
      k: 9297413,
    },
  });
}

/**
 * 获取电影详情数据
 */
export function getFilmInfo(id) {
  return http({
    header: {
      "X-Host": "mall.film-ticket.film.info",
    },
    url: "https://m.maizuo.com/gateway",
    method: "GET",
    data: {
      filmId: id,
      k: 1845989,
    },
  });
}

/**
 * 获取城市列表数据
 */
export function getCityList() {
  return http({
    header: {
      "X-Host": "mall.film-ticket.city.list",
    },
    url: "https://m.maizuo.com/gateway",
    method: "GET",
  });
}
